//
//  AboutEDViewController.m
//  ExpressData
//
//  Created by user on 12/1/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "AboutEDViewController.h"


@implementation AboutEDViewController
@synthesize myTableView;
@synthesize myScrollView;
NSMutableArray *text;
/*
 // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
        // Custom initialization
    }
    return self;
}
*/


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
	self.view.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed:@"background1.png"]];
	text = [[NSMutableArray alloc] init];
	
	[text addObject:@"Express Data is Australia and New Zealand's leading ICT distributor"];
	[text addObject:@"Express Data was incorporated on October 1, 1996."];
	[text addObject:@"Express Data’s head office is in Botany, Sydney."];
	[text addObject:@"There are branch offices in all major capital cities and in New Zealand."];
	[text addObject:@"Express Data represents leading technology vendors."];
	[text addObject:@"Express Data has nearly 300 staff in total – throughout ANZ."];
	myTableView.backgroundColor = [UIColor colorWithRed:205 green:201 blue:201 alpha:0.2];
	self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
	myScrollView.contentSize = CGSizeMake(200,450);

}
	

// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return YES;
}


- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
	[text release];
    [super dealloc];
}

// Customize the number of sections in the table view.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}


// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [text count];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
	return 44;
}


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
		
    }
	
	
	NSString *cellvalue = [text objectAtIndex:indexPath.row];
	[cell.textLabel setText:cellvalue];
	cell.textLabel.textColor = [UIColor blackColor];	
	cell.textLabel.font = [UIFont systemFontOfSize:14]; //Change this value to adjust size
	cell.textLabel.numberOfLines = 3; 		
	
	
    NSString *cellIconName = @"bullet.png";
    UIImage *cellIcon = [UIImage imageNamed:cellIconName];
    [[cell imageView] setImage:cellIcon];

    return cell;


}
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
	if (indexPath.row % 2)
	{
		
        [cell setBackgroundColor:[[UIColor alloc] initWithRed:220.0 / 255 green:220.0 / 255 blue:220.0 / 255 alpha:1.0]];
	}
	
	else         [cell setBackgroundColor:[[UIColor alloc] initWithRed:255.0 / 255 green:250.0 / 255 blue:240.0 / 255 alpha:1.0]];
}

@end
